/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.germinus.telcoblocks.provider;


import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.germinus.telcoblocks.Centralita_VOIP;
import org.germinus.telcoblocks.TelcoblocksPackage;

/**
 * This is the item provider adapter for a {@link org.germinus.telcoblocks.Centralita_VOIP} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class Centralita_VOIPItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Centralita_VOIPItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addIPPropertyDescriptor(object);
			addUsercalleridPropertyDescriptor(object);
			addBindportPropertyDescriptor(object);
			addBindaddrPropertyDescriptor(object);
			addDomainPropertyDescriptor(object);
			addVideosupportPropertyDescriptor(object);
			addExternrefreshPropertyDescriptor(object);
			addTipoPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the IP feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addIPPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Servidor_IP_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Servidor_IP_feature", "_UI_Servidor_type"),
				 TelcoblocksPackage.Literals.SERVIDOR__IP,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Usercallerid feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addUsercalleridPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_usercallerid_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_usercallerid_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__USERCALLERID,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Bindport feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addBindportPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_bindport_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_bindport_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__BINDPORT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Bindaddr feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addBindaddrPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_bindaddr_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_bindaddr_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__BINDADDR,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Domain feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addDomainPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_domain_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_domain_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__DOMAIN,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Videosupport feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addVideosupportPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_videosupport_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_videosupport_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__VIDEOSUPPORT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Externrefresh feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addExternrefreshPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_externrefresh_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_externrefresh_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__EXTERNREFRESH,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Tipo feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addTipoPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Centralita_VOIP_tipo_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Centralita_VOIP_tipo_feature", "_UI_Centralita_VOIP_type"),
				 TelcoblocksPackage.Literals.CENTRALITA_VOIP__TIPO,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This returns Centralita_VOIP.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/Centralita_VOIP"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		String label = ((Centralita_VOIP)object).getIP();
		return label == null || label.length() == 0 ?
			getString("_UI_Centralita_VOIP_type") :
			getString("_UI_Centralita_VOIP_type") + " " + label;
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(Centralita_VOIP.class)) {
			case TelcoblocksPackage.CENTRALITA_VOIP__IP:
			case TelcoblocksPackage.CENTRALITA_VOIP__USERCALLERID:
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDPORT:
			case TelcoblocksPackage.CENTRALITA_VOIP__BINDADDR:
			case TelcoblocksPackage.CENTRALITA_VOIP__DOMAIN:
			case TelcoblocksPackage.CENTRALITA_VOIP__VIDEOSUPPORT:
			case TelcoblocksPackage.CENTRALITA_VOIP__EXTERNREFRESH:
			case TelcoblocksPackage.CENTRALITA_VOIP__TIPO:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return TelcoblocksEditPlugin.INSTANCE;
	}

}
